@extends("layout.main")
@include("layout.nav")
@section("content")

<div class="layui-container">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            <div class="fly-panel" style="margin-bottom: 0;">
                <div class="fly-panel-title fly-filter">
                    <a @if(request('is_jing')==''&& request('status')=='') class="layui-this" @endif  href="/question?cate_id={{request('cate_id')}}">综合</a>
                    <span class="fly-mid"></span>
                    <a @if(request('status')==='0') class="layui-this" @endif  href="/question?status=0&cate_id={{request('cate_id')}}">未结</a>
                    <span class="fly-mid"></span>
                    <a @if(request('status')==1) class="layui-this" @endif  href="/question?status=1&cate_id={{request('cate_id')}}">已结</a>
                    <span class="fly-mid"></span>
                    <a @if(request('is_jing')==1) class="layui-this" @endif href="/question?is_jing=1&cate_id={{request('cate_id')}}">精华</a></div>
                <ul class="fly-list">
                    @foreach($questions as $question)
                    <li>
                        <a href="/question/{{$question->id}}/show" class="fly-avatar">
                            <img src="{{$question->user->face}}" alt="空白处"></a>
                        <h2>
                            <a class="layui-badge">{{$question->cate->name}}</a>
                            <a href="/question/{{$question->id}}/show">{{$question->title}}</a></h2>
                        <div class="fly-list-info">
                            <a href="/user/{{$question->user->id}}" link>
                                <cite>{{$question->user->name}}</cite></a>
                            <span>{{$question->created_at->diffForHumans()}}</span>
                            <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻">
                                        <i class="iconfont icon-kiss"></i>{{$question->kiss}}</span>
                            <span class="fly-list-nums">
                                        <i class="iconfont icon-pinglun1" title="回答"></i>0</span>
                        </div>
                        <div class="fly-list-badge"></div>
                    </li>
                    @endforeach
                </ul>
                <div id="pull_right">
                    <div class="pull-right">
                        {{$questions->appends($where)->links()}}
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-md4">
            <dl class="fly-panel fly-list-one">
                <dt class="fly-panel-title">本周热议</dt>
                @foreach($hotQuestions as $question)
                    <dd>
                        <a href="/question/{{$question->id}}/show">{{$question->title}}</a>
                        <span>
                                <i class="iconfont icon-pinglun1"></i>{{$question->answers_count}}</span>
                    </dd>
                @endforeach
            </dl>
            <div class="fly-panel">
                <div class="fly-panel-title">钻级赞助商
                    <span class="fly-mid"></span>
                    <a href="/jie/15697/" class="fly-link fly-joinad    ">我要加入</a></div>
                <div class="fly-panel-main" style="padding: 13px 15px;">
                    <a href="/jie/15697/" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #393D49;">虚席以待</a></div>
            </div>
            <div class="fly-panel" style="padding: 20px 0; text-align: center;">
                <img  style="max-width: 100%;" alt="layui">
                <p style="position: relative; color: #666;">微信扫码关注 layui 公众号</p></div>
        </div>
    </div>
</div>
@endsection